package com.example.education.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.education.Bean.CollegeInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 姚
 * @since 2023-03-27
 */

@Mapper
public interface CollegeInfoMapper extends BaseMapper<CollegeInfo> {

    //增
    @Insert("INSERT INTO college_info (uid,college_name,introduction,target_College_Count) values (#{uid},#{collegeName},#{introduction},#{targetCollegeCount})")
    int insert(CollegeInfo collegeInfo);

    //删
    @Delete("delete from college_info where uid=#{uid}")
    int delete(Integer uid);

    //根据学校名字查找学校
    @Select("select * from college_info where college_name=#{collegeName}")
    CollegeInfo select(String collegeName);

    //改
    int update(CollegeInfo collegeInfo);

    //查询所有大学
    @Select("select * from college_Info")
    CollegeInfo[] selectAll();

}
